package org.quartz.impl.rmi.entity;

import java.util.concurrent.locks.ReentrantReadWriteLock;

/**
 * Created by guowei on 2018/1/14.
 */
public class MutexResource {
    private ReentrantReadWriteLock lock = new ReentrantReadWriteLock();

    public void getRLock(){
        lock.readLock().lock();
    }

    public void releaseRLock(){
        lock.readLock().unlock();
    }

    public void getWLock(){
        lock.writeLock().lock();
    }

    public void releaseWLock(){
        lock.writeLock().unlock();
    }
}
